package com.engr.lyx.controller;

import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program springboot-flowable
 * @description:
 * @author: LiuYanXin
 * @create: 2020-08-21 17:14
 */
@RestController
public class LeaveController {

    @Autowired
    private TaskService taskService;

    @Autowired
    private RuntimeService runtimeService;

    @Autowired
    private HistoryService historyService;

    @GetMapping("/test")
    public List<Task> getAllTask(@RequestParam String dept) {

        List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup(dept).
                listPage(1, 10);

        return tasks;
    }

}
